<template>
  <Card style="width:100%" class="detail-content-layout mb16" v-if="form.approvalByStr && !info.progressCode">
    <template #title>
      {{ $t('驳回') }}
    </template>
    <template #extra>
      <div class="h-arrow-wrap" @click="toggle = !toggle">
        <i :class="{toggleActive:toggle}" class="iconfont zy-common-jiantou h-arrow-icon"></i>
      </div>
    </template>
    <transition name="slide-up">
      <div v-if="toggle">
        <Form ref="form" :model="form" label-position="top">
          <Row :gutter="24">
            <Col span="6">
              <FormItem :label="$t('审批人')">
                <Input disabled clearable type="text" v-model="form.approvalByStr"
                       :placeholder="$t('请输入')"></Input>
              </FormItem>
            </Col>
            <Col span="6">
              <FormItem :label="$t('驳回时间')">
                <Input disabled clearable type="text" v-model="form.approvalTime" :placeholder="$t('请输入')"></Input>
              </FormItem>
            </Col>
            <Col span="6">
              <FormItem :label="$t('驳回原因')">
                <Input disabled clearable type="text" v-model="form.remark" :placeholder="$t('请输入')"></Input>
              </FormItem>
            </Col>
          </Row>
        </Form>
      </div>
    </transition>
  </Card>
</template>

<script>

export default {
  name: "bdgApprovalReject",
  components: {},
  mixins: [],
  props: {
    info: {
      type: Object,
      default: () => {
      }
    }
  },
  data() {
    return {
      toggle: true,
      form: {}
    }
  },
  created() {
    if (Array.isArray(this.info.rejectFlows)) {
      const obj = this.info.rejectFlows.find(item => item.progressCode === "BDG Approval")
      if (obj) {
        const {approvalByStr, approvalTime, approvalRemark} = obj
        if (approvalTime)
          this.form = Object.assign(this.form, {
            remark: approvalRemark,
            approvalByStr,
            approvalTime,
          })
        this.toggle = true
      }
    }
  },
  methods: {
    async getParams() {

    }
  }
}
</script>

<style scoped lang="scss">
@import "./style";

</style>

